function log(){
  return function (target, name, descripto){
    var oldValue = descriptor.value;
  
    descriptor.value = function () {
      console.log(`Calling ${name} with`, arguments);
      return oldValue.apply(this, arguments);
    };
  
    return descriptor;
  }
}


class test {
  @log()
  say(word){
    console.log(`输入参数为 ${word}`);
  }
}

let abc = new test()
abc.say()



let logC = (type) => {
  return function (target, name, descriptor) {
    console.log("@log:", target);
    console.log("@log:==>name", name);
    console.log("@log:==>descriptor", descriptor);
    // console.log("@log:==>descriptor 参数", descriptor.value.arguments);
    var oldValue = descriptor.value;
    descriptor.value = function () {
      console.log(`Calling ${name} with`, arguments);
      return oldValue.apply(this, arguments);
    }
    return descriptor
  }
}
function logA () {
  return function (target, name, descriptor) {
    var oldValue = descriptor.value;

    descriptor.value = function () {
      console.log(`Calling ${name} with`, Array.from(arguments));
      return oldValue.apply(this, arguments);
    };

    return descriptor;
  }
}
function logB () {
  return function (target, name, descriptor) {
    console.log("@log:", target);

    // var oldValue = descriptor.value;

    // target.newVal = function () {
    console.log(`Calling logB with`, arguments, Array.from(arguments));
    // };
    // target.newVal()

    return target;
  }
}